package com.thankgod7.jobcenter.entity;

import cn.hutool.core.util.HexUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * his患者基本信息
 *
 * @author thankgod7
 */
@Data
@TableName("CMS_BRJBXX")
public class HisPatient implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * hash Byte
     */
    @TableField(value = "hash")
    @JsonIgnore
    private byte[] hashByte;

    /**
     * hash
     */
    @TableField(exist = false)
    private String hash;

    public String getHash() {
        return HexUtil.encodeHexStr(hashByte);
    }

    /**
     * 患者身份证
     */
    private String hzsfz;

    /**
     * 患者姓名
     */
    private String hzxm;

    /**
     * 联系电话
     */
    private String lxdh;

    /**
     * 病历号
     */
    private String blh;

    /**
     * 性别
     */
    private String sex;

    /**
     * 出生日期
     */
    private String birth;

    /**
     * 证件类型
     */
    private String zjlx;

    /**
     * 证件号
     */
    private String zjh;

    /**
     * 名族
     */
    private String mz;

    /**
     * 国籍
     */
    private String guoji;

    /**
     * 职业
     */
    private String zy;

    /**
     * 联系人姓名
     */
    private String lxrxm;

    /**
     * 联系人关系
     */
    private String lxrgx;

    /**
     * 联系人电话
     */
    private String lxrdh;

    /**
     * 联系人地址
     */
    private String lxdz;

    /**
     * 记录状态
     */
    private String jlzt;

    /**
     * 贫困户标识
     */
    private String pkhbz;

    /**
     * 医保代码
     */
    private String ybdm;

    /**
     * 医保说明
     */
    private String ybsm;

    /**
     * 登记日期
     */
    private String djrq;

    /**
     * 卡号
     */
    private String cardno;

    /**
     * 卡类型
     */
    private String cardtype;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        HisPatient that = (HisPatient) o;
        return Objects.equals(hzsfz, that.hzsfz) && Objects.equals(hzxm, that.hzxm) && Objects.equals(lxdh, that.lxdh) && Objects.equals(blh, that.blh) && Objects.equals(sex, that.sex) && Objects.equals(birth, that.birth) && Objects.equals(zjlx, that.zjlx) && Objects.equals(zjh, that.zjh) && Objects.equals(mz, that.mz) && Objects.equals(guoji, that.guoji) && Objects.equals(zy, that.zy) && Objects.equals(lxrxm, that.lxrxm) && Objects.equals(lxrgx, that.lxrgx) && Objects.equals(lxrdh, that.lxrdh) && Objects.equals(lxdz, that.lxdz) && Objects.equals(jlzt, that.jlzt) && Objects.equals(pkhbz, that.pkhbz) && Objects.equals(ybdm, that.ybdm) && Objects.equals(ybsm, that.ybsm) && Objects.equals(djrq, that.djrq) && Objects.equals(cardno, that.cardno) && Objects.equals(cardtype, that.cardtype);
    }

    @Override
    public int hashCode() {
        return Objects.hash(hzsfz, hzxm, lxdh, blh, sex, birth, zjlx, zjh, mz, guoji, zy, lxrxm, lxrgx, lxrdh, lxdz, jlzt, pkhbz, ybdm, ybsm, djrq, cardno, cardtype);
    }
}
